import React from 'react';
import { inject, observer } from 'mobx-react';

@inject('rootStore')
@observer
class Home extends React.Component {
    constructor(props) {
        super(props);
        this.state = {
            title: this.props.rootStore.homeStore.title
        }
    }

    componentDidMount() {
        console.log(this.props);
        this.props.rootStore.homeStore.updateName('大哥');
    }
    
    render() {
        return (
            <div>
                { this.props.rootStore.homeStore.name }, { this.state.title }
            </div>
        )
    }
}

export default Home;